﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lilium.LParse.TextExtensions
{
    public static class CharExtensions
    {
        /// <summary>
        /// Synonym for <see cref="TextParsers.Char"/> parser.
        /// </summary>
        public static Parser<char, char> Match(this char chr)
        {
            return TextParsers.Char(chr);
        }

        /// <summary>
        /// Semantically equivalent to TextParsers.Char(chr).SkipMany().
        /// </summary>
        public static Parser<char, object> SkipMany(this char chr)
        {
            return TextParsers.Char(chr).SkipMany();
        }

        /// <summary>
        /// Synonym for <see cref="TextParsers.Range"/> parser.
        /// </summary>
        public static Parser<char, char> To(this char from, char to)
        {
            return TextParsers.Range(from, to);
        }
    }
}
